package com.example.services;

import com.example.dao.AccountDao;
import com.example.pojo.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wushuai on 17/8/31.
 */
@Service("accountService")
public class AccountServiceImpl implements AccountService {
    @Autowired
    AccountDao accountDao;

    public Account findUser (String un, String pw) {
        return accountDao.selectUser(un, pw);
    }

    public List<Account> findAll () {
        return accountDao.findAll();
    }

    public boolean addAccount (String username, String password) {
        Account account = new Account(username, password);
        return accountDao.addAccount(account);
    }
}
interface AccountService {

    public Account findUser (String un, String pw);
    public List<Account> findAll ();
}
